package br.com.tcc.utils;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class ThreadUtils {
	private static final String TAG = "ThreadUtils";
	
	public static void sendMessage(int what, Object obj, Handler handler) {
		Message msg = new Message();
		msg.what = what;
		if (obj != null) {
			msg.obj = obj;
		}
		
		handler.sendMessage(msg);
	}
	
	public static void sleep(long time) {
		try {
			Thread.sleep(time);
		} catch (InterruptedException e) {
			Log.e(TAG, e.getMessage(), e);
		}
	}

}
